Ext.onReady(function(){
  var id = Ext.getHashParam('id');
  
  var url = restPath + '/edit-row/edit-row-form-data';

  var formPanel = new Ext.FormPanel({
    renderTo: 'form-id',
    border: false,
    buttonAlign:'left',
    monitorResize: true,
    monitorValid: true,
    width: 400,

    labelAlign: 'top',   // or 'right' or 'left'
    
    items: [{
      xtype: 'textfield',
      fieldLabel: 'stringAttribute',
      name: 'stringAttribute',
      id: 'stringAttribute',
      anchor: '0',
      allowBlank: false,
      
      regex: /^[a-zA-Z]/,
      regexText: "Value must start with a letter (regex fail).",
      
      validator: function (value) {
        if(value == 'validatorfail') {
          return "Value is not allowed to be 'validatorfail'.";
        } else {
          return true;
        }
      }
    }],
    
    buttons: [{
      text:'OK',
      id: 'submit-button',
      formBind: true,
      handler: MyApp.common.handleFormSubmit(url, id, 'edit-row-confirmation.html')
    }],
    
    defaults: MyApp.common.submitWithEnterFormFieldDefault("submit-button")
  });
  
  MyApp.common.loadForm(formPanel, url, id);
});